<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="../user_pass2.jsp" %>
<%
int remainSize = userLogin.getUpfileSize().intValue() - userLogin.getUpfileUsedSize().intValue();

String uploadType = request.getParameter("uploadType");	//上传文件类型：0-公用文件，1-公用图片，2-个人文件，3-个人图片
if(uploadType==null||uploadType.trim().equals(""))
    uploadType = "0";
%>
<html>
<head>
<title>文件上传组件</title>
<%@ include file="../../common/meta.inc" %>
<link rel="stylesheet" type="text/css" href="css/upload.css" >
<script language="javascript" type="text/javascript" src='js/upload.js'> </script>
<script language="javascript" type="text/javascript" src='<%=request.getContextPath() %>/dwr/interface/UploadMonitor.js'> </script>
<script language="javascript" type="text/javascript" src='<%=request.getContextPath() %>/dwr/engine.js'> </script>
<script language="javascript" type="text/javascript" src='<%=request.getContextPath() %>/dwr/util.js'> </script>

</head>
<body>
<script language="javascript">
var uploadType = "<%=uploadType%>";

function validateForm(form)
{
    if(uploadType=="1"||uploadType=="3")
    {
    	if(!sl_check_upload_limit(form.uploadfile,'gif,jpg,jpeg,bmp,png')) return false;  
    } 
    startProgress();
    return true;
}
</script>
<form action="upload.jsp" enctype="multipart/form-data" method="post" onsubmit="return validateForm(this)"  target="hiddenIframe">
<input type="hidden" id="uploadType" name="uploadType" value="<%=uploadType %>"/>
<input class="default" type="file" id="uploadfile" name="uploadfile"/>
<input type="submit" class="btn" value="上传" id="uploadbutton" name="uploadbutton"/>
<span id="resultMsg" class='remark'>(您的剩余上传空间约为：<%=remainSize %>kb)</span>
        <div id="progressBar" style="display:'none'">
            <div id="theMeter">
                <span id="progressBarText"></span>
                <span id="progressBarBox">
                    <span id="progressBarBoxContent"></span>
                </span>
            </div>
        </div>         
</form>
<iframe name="hiddenIframe" id="hiddenIframe" width="0" height="0" frameborder="0"></iframe>
</body>
</html>